package com.example.qxfw.nyqx.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.qxfw.common.entity.qx.soilHumidity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
@DS("qx")
public interface SoilHumidityMapper extends BaseMapper<soilHumidity> {

    @Select("select distinct rtrim(StationId, '') as StationId " +
            "from soil_humidity " )
    List<String> selectStationId();

    @Select("select avg(relhumidity) as relhumidity, to_char(observetime,'yyyy/MM/dd') as observetime " +
            "from soil_humidity  " +
            "where stationid='${stationId}' and observetime between '${time1}' and '${time2}' and relhumidity>-65535 and level='${level}' ")
    List<soilHumidity> selectList(String stationId,String time1,String time2,String level);
}
